<template>
	<view class="Menu">

		<z-paging ref="paging" v-model="dataList" @query="getDataList" class="listboxs" default-page-size="15">
			<template #top>
				<view class="title">
					<view class="titleL">
						数量
						<view>
							<view>
								<u-icon size="10" name="arrow-up-fill" :color="clicked==1?'#606266':'#327CFF'"
									@click="dianji(clicked)"></u-icon>
							</view>
							<view>
								<u-icon size="10" name="arrow-down-fill" :color="clicked1==1?'#606266':'#327CFF'"
									@click="dianji1(clicked1)"></u-icon>
							</view>
						</view>
					</view>
					<view style="margin-left: 60rpx;" class="titleL">
						时间
						<view>
							<view>
								<u-icon size="10" name="arrow-up-fill" :color="clicked2==1?'#606266':'#327CFF'"
									@click="dianji2(clicked2)"></u-icon>
							</view>
							<view>
								<u-icon size="10" name="arrow-down-fill" :color="clicked3==1?'#606266':'#327CFF'"
									@click="dianji3(clicked3)"></u-icon>
							</view>
						</view>
					</view>
				</view>
			</template>
			<view class="orderList" v-for="(item,index) in dataList" :key="index">
				<view class="listT">{{item.nickname}}</view>
				<view class="listc">{{item.money}} YLD</view>
				<view class="listb">
					<view class="name">
						<span>合计:{{item.mai_yj_money}} USDT</span>
					</view>
					<view>
						<view class="btn" @click="purchase(item)">购买</view>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				dataList: [],
				clicked: 1,
				clicked1: 1,
				clicked2: 1,
				clicked3: 1,
				money: '',
				time: ''
			};
		},
		mounted() {


		},

		methods: {
			dianji(e) {
				if (e == 1) {
					this.clicked = 2
					this.clicked1 = 1
					this.money = 'asc'
				} else {
					this.clicked = 1
					this.money = ''
				}
				this.getDataList()
			},
			dianji1(e) {
				if (e == 1) {
					this.clicked1 = 2
					this.clicked = 1
					this.money = 'desc'
				} else {
					this.clicked1 = 1
					this.money = ''
				}
				this.getDataList()
			},
			dianji2(e) {
				if (e == 1) {
					this.clicked2 = 2
					this.clicked3 = 1
					this.time = 'asc'
				} else {
					this.clicked2 = 1
					this.time = ''
				}
				this.getDataList()
			},
			dianji3(e) {
				if (e == 1) {
					this.clicked2 = 1
					this.clicked3 = 2
					this.time = 'desc'
				} else {
					this.clicked3 = 1
					this.time = ''
				}
				this.getDataList()
			},
			getDataList(pageNo, pageSize) {
				uni.request({
					url: "/user/moneyDealOutList",
					method: "POST",
					data: {
						page: pageNo,
						money: this.money,
						time: this.time
					},
					// 1.1.8 升级
					success: (res) => {
						if (res.res.code == 1) {
							this.$refs.paging.complete(res.res.data.list);
						}
					},
					fail() {
						this.$refs.paging.complete(false);
					}
				});
			},
			purchase(val) {
				this.$wanlshop.to(`/pages/newPage/purchaseOrder?yld=${val.money}&usdt=${val.mai_yj_money}&id=${val.id}`);
			}

		}
	};
</script>

<style lang="scss">
	.Menu {
		background: #f8f8f8;



		.listboxs {
			// background: #fff;
			margin-top: 34rpx;
			padding-bottom: 50rpx;

			.title {
				padding: 34rpx 30rpx;
				background: #fff;
				margin-top: 80rpx;
				display: flex;
				align-items: center;

				.titleL {
					display: flex;
					align-items: center;

					/deep/.u-icon {
						margin-left: 10rpx;
					}
				}
			}

			.orderList {
				margin: 0 24rpx;
				padding: 34rpx 30rpx;
				background: #fff;
				border-radius: 16rpx;
				margin-bottom: 20rpx;
				margin-top: 24rpx;
				font-weight: 500;
				font-size: 28rpx;
				color: #333333;

				.listc,
				.listb {
					margin-top: 20rpx;
				}

				.listc {
					font-size: 16px;
					font-weight: bold;
				}

				.listb {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.btn {
						background: #327CFF;
						border-radius: 4rpx;
						padding: 10rpx 32rpx;
						color: #fff;

					}
				}
			}

		}

	}
</style>